// JavaScript Document
window.onload=function(){
	//display();
	var current_element = "restaurant-information";
	tab();
	window.addEventListener("scroll",navbar_reset_top,false);
	
	
}
function tab(){
	var element = document.getElementsByClassName("admin-tab");
	var element2 = document.getElementsByClassName("tab-content-container");
	for (var i=0; i<element.length; i++){
		element[i].onclick = function(){
			for (var i=0; i<element.length; i++){
				element[i].className = "admin-tab";
				element2[i].style.display="none";
			}
			this.className = "admin-tab current-tab"; 
			document.getElementsByClassName(this.name + '-container')[0].style.display = "block";
		}
	}
}

var navbar_top=40;
var navbar = document.getElementById("cart-container");

function navbar_reset_top() {
  var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
  if(scrollTop>navbar_top&&navbar.className==="cart-container-absolute") {
    navbar.className="cart-container-fixed";
  }
  else if(scrollTop<navbar_top&&navbar.className==="cart-container-fixed") {
    document.getElementById("cart-container").className="cart-container-absolute";
  }
}

//function display(){
//	var element = document.getElementById("cart-items-container");
//	if(element.style.height == '0px'){
//		element.style.height = 'auto';
//	} else {
//		element.style.height = '0px';
//	}
//}
//function display2(){
//	var element2 = document.getElementsByClassName("cart-item");
//	element2.style.display = ( element2.style.display == "none" ) ? "block" : "none";
//}